/***************************************************************************
 *   Copyright (C) 2009 by Dead_Body                                       *
 *   jamesholodnak@gmail.com                                               *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef __config_h__
#define __config_h__

#include "types.h"

typedef struct configvar_s {
	void *data;
	int type;
	char *name;
	char *desc;
} configvar_t;

typedef struct config_s {

	//global configuration options
	char path_rom[512];			//path to roms (also last directory browsed)
	char path_state[512];		//path to save states
	char path_cheat[512];		//path to disk change states
	char path_hi[512];			//highscore path
	char path_nvram[512];		//nvram path
	char path_shots[512];		//screenshot path
	u32 soundenabled;		//sound enabled
	u32 soundchannels;	//enabled sound channels
	//stick system dependent config variables
	//elsewhere, do not define them here
	u32 filter;				//video filter
	u32 windowed;			//set to 1 if we are in windowed mode
	u32 windowscale;		//window size for windowed mode
	u32 fullscreen;		//fullscreen mode
	u32 shotformat;		//screenshot format
	u32 showinfo;			//show info at top while playing game
	char recent[10][1024];	//recent files
	u32 recentfreeze;

	//input configuration
	u32 gui_keys[16];			//gui keys
	u32 joy_keys[4][10];		//key config for joypads
} config_t;


class CConfiguration {
	public:
		CConfiguration();
		virtual ~CConfiguration();
		virtual bool Load();
		virtual bool Save();
};

//these both are actually defined in nesemu.c
extern char path_config[];		//path to configuration file (set by config_defaults() or
extern config_t config;			//some other system dependent reset call)

//system dependent config functions
void config_defaults();			//set configuration defaults
int config_load();
int config_save();

#endif
